-- The most amazing green mod ever! By Megaf - http://megaf.info/ http://megaf.wordpress.com/
-- Registering The Amazinly Insanily Awesome and Brilliant Leprechaun Crystal!

--##################################################################################################################

minetest.register_craftitem("leprechaun_tools:leprechaun_crystal", {
	description = "Cristal de Leprechau",
	inventory_image = "leprechaun_crystal.png",
})

minetest.register_craft({
	output = 'leprechaun_tools:leprechaun_crystal',
	recipe = {
		{'default:mese_crystal'	, 'default:diamond'			, 'default:mese_crystal'},
		{'default:diamond'		, 'default:mese_crystal'	, 'default:diamond'},
	}
})

minetest.register_craft({
	output = 'leprechaun_tools:leprechaun_crystal',
	recipe = {
		{'default:diamond'		, 'default:mese_crystal'	, 'default:diamond'},
		{'default:mese_crystal'	, 'default:diamond'			, 'default:mese_crystal'},
	}
})

minetest.register_alias('leprechaun_crystal', 'leprechaun_tools:leprechaun_crystal')
minetest.register_alias('cristaldeleprechau', 'leprechaun_tools:leprechaun_crystal')

--##################################################################################################################

minetest.register_node("leprechaun_tools:leprechaun_block",{
  	description = "Bloco de Leprechau",
	sunlight_propagates = true,
	--visual_scale = 1.0,
	tiles = {"leprechaun_block.png"},
	--groups = {oddly_breakable_by_hand=1 ,attached_node=1},
	groups = {cracky=1,level=2},
	--paramtype = "light",
	--on_use = minetest.item_eat(+50),
})

minetest.register_craft({
	output = 'leprechaun_tools:leprechaun_block',
	recipe = {
		{'leprechaun_tools:leprechaun_crystal', 'leprechaun_tools:leprechaun_crystal', 'leprechaun_tools:leprechaun_crystal'},
		{'leprechaun_tools:leprechaun_crystal', 'leprechaun_tools:leprechaun_crystal', 'leprechaun_tools:leprechaun_crystal'},
		{'leprechaun_tools:leprechaun_crystal', 'leprechaun_tools:leprechaun_crystal', 'leprechaun_tools:leprechaun_crystal'}
	}
})

minetest.register_craft({
	output = 'leprechaun_tools:leprechaun_crystal 9',
	recipe = {
		{'leprechaun_tools:leprechaun_block'},
	}
})

minetest.register_alias('leprechaun_block', 'leprechaun_tools:leprechaun_block')
minetest.register_alias('blocodeleprechau', 'leprechaun_tools:leprechaun_block')

--##################################################################################################################


-- Registering Tools.
minetest.register_tool("leprechaun_tools:pick_leprechaun", {
	description = "Picareta de Leprechau",
	inventory_image = "leprechaun_pick.png",
	tool_capabilities = {
		full_punch_interval = 0.9,
		max_drop_level=3,
		groupcaps={
			cracky = {times={[1]=1.5, [2]=0.9, [3]=0.50}, uses=80, maxlevel=3},
		},
		damage_groups = {fleshy=5},
	},
})

minetest.register_craft({
	output = 'leprechaun_tools:pick_leprechaun',
	recipe = {
		{'leprechaun_tools:leprechaun_crystal', 'leprechaun_tools:leprechaun_crystal', 'leprechaun_tools:leprechaun_crystal'},
		{'', 'group:stick', ''},
		{'', 'group:stick', ''},
	}
})

minetest.register_alias('picaretadeleprechau', 'leprechaun_tools:pick_leprechaun')

--##################################################################################################################


minetest.register_tool("leprechaun_tools:shovel_leprechaun", {
	description = "Pa de Leprechau",
	inventory_image = "leprechaun_shovel.png",
	wield_image = "leprechaun_shovel.png^[transformR90",
	tool_capabilities = {
		full_punch_interval = 1.0,
		max_drop_level=1,
		groupcaps={
			crumbly = {times={[1]=0.8, [2]=0.30, [3]=0.10}, uses=80, maxlevel=3},
		},
		damage_groups = {fleshy=4},
	},
})

minetest.register_craft({
	output = 'leprechaun_tools:shovel_leprechaun',
	recipe = {
		{'leprechaun_tools:leprechaun_crystal'},
		{'group:stick'},
		{'group:stick'},
	}
})

minetest.register_alias('padeleprechau', 'leprechaun_tools:shovel_leprechaun')

--##################################################################################################################

minetest.register_tool("leprechaun_tools:axe_leprechaun", {
	description = "Machado de Leprechau",
	inventory_image = "leprechaun_axe.png",
	tool_capabilities = {
		full_punch_interval = 0.9,
		max_drop_level=1,
		groupcaps={
			choppy={times={[1]=1.20, [2]=0.70, [3]=0.30}, uses=80, maxlevel=2},
		},
		damage_groups = {fleshy=7},
	},
})

minetest.register_craft({
	output = 'leprechaun_tools:axe_leprechaun',
	recipe = {
		{'leprechaun_tools:leprechaun_crystal', 'leprechaun_tools:leprechaun_crystal'},
		{'leprechaun_tools:leprechaun_crystal', 'group:stick'},
		{'', 'group:stick'},
	}
})

minetest.register_craft({
	output = 'leprechaun_tools:axe_leprechaun',
	recipe = {
		{'leprechaun_tools:leprechaun_crystal', 'leprechaun_tools:leprechaun_crystal'},
		{'group:stick', 'leprechaun_tools:leprechaun_crystal'},
		{'group:stick', ''},
	}
})

minetest.register_alias('machadodeleprechau', 'leprechaun_tools:axe_leprechaun')

--##################################################################################################################

minetest.register_tool("leprechaun_tools:sword_leprechaun", {
	description = "Espada de Leprechau",
	inventory_image = "leprechaun_sword.png",
	tool_capabilities = {
		full_punch_interval = 0.7,
		max_drop_level=1,
		groupcaps={
			snappy={times={[1]=0.70, [2]=0.40, [3]=0.15}, uses=80, maxlevel=3},
		},
		damage_groups = {fleshy=8},
	}
})

minetest.register_craft({
	output = 'leprechaun_tools:sword_leprechaun',
	recipe = {
		{'leprechaun_tools:leprechaun_crystal'},
		{'leprechaun_tools:leprechaun_crystal'},
		{'group:stick'},
	}
})

minetest.register_alias('espadadeleprechau', 'leprechaun_tools:sword_leprechaun')

--##################################################################################################################

minetest.log('action','[LEPRECHAUN_TOOLS] Carregado!')